import java.util.Scanner;

public class HomeWork19 {
    public static void main(String[]args){
        Scanner s =new Scanner(System.in);
        System.out.println("请告诉我一个年份，以及一个月份，我可以告诉你这一年的这个月有多少天。");

        System.out.print("请输入年份；");
        int month = s.nextInt();

        System.out.print("请输入月份");
        int year = s.nextInt();


        if(month ==1 ||month ==3 || month==5||month==7||month==8||month==10||month==12){
        System.out.println(year+"年"+month+"月有31天");
        }else if(month ==4||month ==6 ||month ==9||month ==11) System.out.println(year + "年" + month + "月有30天");
        else{
            if ((year%4==0&&year%100!=0)||year%400 == 0){
                System.out.println(year+"年"+month+"月有29天");
                System.out.println(year+"年"+month+"月有28天");

            }
        }
    }
}

